package com.xuetang9.cloudhouse.permissionserver.controller;

import com.xuetang9.cloudhouse.commons.beans.User;
import com.xuetang9.cloudhouse.permissionserver.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.List;

/**
 * @author 老九.大师兄
 * @version 1.0
 * @desc
 * @date 2020/6/2-19:15
 * @copyright &copy; xuetang9
 * @address 成都市西部国际金融中心2栋2201
 */
@RestController
@RequestMapping("u")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("all")
    public Mono<List<User>> queryAll(){
        return Mono.create(data->data.success(userService.queryAll()));
    }
}
